import axios from '@/api/fetch';
//import * as types from './types';
import SERVER from '@/api/server';

//索赔费用调整-主机厂
//索赔类型取得
export const getclaimType = (params) => axios.get(`${SERVER.CLAIMFAC}/const/getBaseDataByType`, { params });
//索赔费用调整-主页面查询
export const getListByPage = params => axios.post(`${SERVER.CLAIMFAC}/rPCmsClaim/getListByPage`,  params );
//修改回显
export const quyrPCmsClaim = (id, params) => axios.get(`${SERVER.CLAIMFAC}/rPCmsClaim/selectById/${id}`, { params });



//编辑的保存
export const editSave = params => axios.post(`${SERVER.CLAIMFAC}/rPCmsClaim/updateByPtId`,  params );
//审核记录
export const getShList = params => axios.post(`${SERVER.CLAIMFAC}/rPCmsClaimLog/getListByPage`,  params );
//维修历史
export const getRoLogList = params => axios.get(`${SERVER.CLAIMFAC}/const/getRoLogList`,  {params} );
//索赔历史
export const getSpList = params => axios.post(`${SERVER.CLAIMFAC}/rPCmsClaim/getListByPage`,  params );


//新增的保存
export const newSave = params => axios.post(`${SERVER.CLAIMFAC}/rPCmsClaim/saveOne`,  params );
//批量启动
export const piliangqiyong = data => axios.post(`${SERVER.CLAIMFAC}/rPCheckReason/updateEnableByIds`,  null ,{params : data} );
//批量停用
export const piliangtingyong = data => axios.post(`${SERVER.CLAIMFAC}/rPCheckReason/updateEnableByIds`,  null ,{params : data} );



//通过ID查
export const quySP = params => axios.get(`${SERVER.CLAIMFAC}/rPCmsClaim/selectById/${params.id}`);

//导出模版
export const downloadModel = params => {
  const url = `${SERVER.CLAIMFAC}/rPCheckReason/exportModel`;
  return axios({
    url,
    method: 'post',
    responseType: 'blob'
  });
};
//导出
export const getListForExport = (params) => axios.post(`${SERVER.CLAIMFAC}/rPCmsClaim/getMoneyListForExport`, params, {
  responseType: 'blob'
});
//下载中心导出
export const exporturl = params => axios.post(`/api/cmscloud.excel/downloadExcel/exportExcel/${params.CODE}`, params);




